#ifndef MY_MUSIC_H
#define MY_MUSIC_H

#include <QWidget>
#include <QUrl>
#include <QVBoxLayout>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QLabel>

class My_music : public QWidget
{
    Q_OBJECT
public:
    explicit My_music(QWidget *parent = nullptr);
    ~My_music();
    
    QMediaPlayer * music;
    QMediaPlaylist * musiclist;
    
    
    void addMedia(const QUrl &url);
        void clearPlaylist();
        void setPlaybackMode(QMediaPlaylist::PlaybackMode mode);
        void setVolume(int volume);
        void play();
        void pause();
        void stop();
        void setCurrentIndex(int index);
        int currentIndex() const;
        QMediaPlayer::State state() const;
        
    signals:
        void positionChanged(qint64 position);
        void mediaStatusChanged(QMediaPlayer::MediaStatus status);
        void currentIndexChanged(int position);
};
    


#endif // MY_MUSIC_H



